import com.zsx.config.Spring_Config;
import com.zsx.entity.Teacher;
import com.zsx.mapper.DoTeacher;
import com.zsx.mapper.imp.DoTeacherImp;
import javafx.application.Application;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TeacherText {
    public static void main(String[] args) {
        //通过spring的核心配置获得托管的对象集
        ApplicationContext ac=new AnnotationConfigApplicationContext(Spring_Config.class);
        //获得被托管的对象
        Teacher teacher =(Teacher)ac.getBean("teacher");
        System.out.println(teacher);
        DoTeacher doTeacher=ac.getBean(DoTeacherImp.class);
        System.out.println(doTeacher);
        doTeacher.update();
    }
}
